<div style="float:right;height:30px">

</div>
<!-----------------filter form ----------------------------------->
<form action="<?= $admin_base_url; ?>orders/index/" method="post">
<table class="filter" cellspacing="0">
     <tr class='filterhead1'>
    	<td colspan="4"> Filter Options </td>
    </tr>
    <tr class='filterhead2'>
      
        <td> status </td>
        <td> date </td>
        <td>&nbsp;  </td>
        
    </tr>
	<tr> 
    	<td> <select class="txt3" type="text" name="status" value="<?php echo $filter; ?>">
        <option value=""> Select </option>
        <option <?php if($filter=='new') echo "selected";?>> new </option>
        <option <?php if($filter=='delivered') echo "selected";?> > delivered </option>
        <option <?php if($filter=='cancelled') echo "selected";?>> cancelled </option>
       
        </select>
			 </td> 
             <td> <input class="txt3" type="text" name="date" id="o_date" value="<?php echo $filter1; ?>"/><button id="f_btn1">...</button><br />

    <script type="text/javascript">//<![CDATA[
      Calendar.setup({
        inputField : "o_date",
        trigger    : "f_btn1",
        onSelect   : function() { this.hide() },
        showTime   : 12,
        dateFormat : "%Y-%m-%d"
      });
    //]]></script>
			 </td>
       
          <td>
			 <div class="buttons">
				 <button type="submit" name="search" class="positive" value="save" >
			        <img src="<?php echo $admin_image_path?>icons/apply.png" alt=""/>
                    Search
                 </button> 
                 <a href="<?= $admin_base_url; ?>orders/clearFilter?rurl=<?php echo $rurl;?>" class="negative">
			        <img src="<?php echo $admin_image_path?>icons/cross.png" alt=""/>
			        Clear
			   </a>
             </div> 
           </td> 
     </tr> 
</table>
</form>
<table class="tbllist">
<tbody>
<tr>
<th class="tbslno">Sl.No</th>
<th class="tbslno">Order number</th>
<th class="tbname">Member</th>
<th class="tbname">Total Amount</th>
<th class="tbname">Date</th>
<th class="tbname">Status</th>



<th class="tbaction">Action</th>
</tr>
<?php 
if(!empty($orders)) 
{
	foreach($orders as $key => $record) 
	{
		$style = (++$key%2) ? '' : 'alt'; 
?>	
	<tr class="<?php echo $style;?>">
		<td><?= ($cur_page + $key);?></td>
        <td><?php echo $record['order_number'].'-'.$record['order_id']?></td>
        <td>&nbsp; 
        <?php
		$member                   = $this->member_model->getmembers(0, '' , $like, array('id'=>$record['user_id']),'' );
		$member         		  = $member->records[0];?>
		<a rel="facebox" href="<?=$admin_base_url;?>member/view/<?=$record['user_id'];?>"><?=$member['email_id']; ?><a>
		
        </td>
		<td><?php echo $record['total_amount']?></td>
       
        <td><?php echo $record['created']?></td>
    
         <td><?php echo $record['status']?></td>
		<td>
                 <a rel="facebox" href="<?php echo $admin_base_url;?>orders/view/<?php echo $record['order_id'];?>/<?php echo $cur_page;?>" >
        <img border="0" src="<?php echo $admin_image_path;?>view1.png" alt="" title="View" width="19" height="19"/></a>
		
        <a href="<?php echo $admin_base_url;?>orders/cancell/<?php echo $record['order_id'];?>/<?php echo $cur_page;?>" onclick="return confirm('Do you want to cancel this order?');">
        <img border="0" src="<?php echo $admin_image_path;?>cancel.jpg" alt="" title="Cancel" width="16" height="16"/></a>
        <a href="<?php echo $admin_base_url;?>orders/success/<?php echo $record['order_id'];?>/<?php echo $cur_page;?>"><img border="0" src="<?php echo $admin_image_path;?>success.jpg" alt="" title="Success" width="16" height="16"/>
          </a>
		</td>
	</tr>
<?php 
	}
} else {
?>
<tr><td colspan="6">No orders available</td></tr>
<?php }?>
</tbody>
</table>
<div class="spacer10 rightText">
<?php 	echo $this->pagination->create_links();?>
</div>